#pragma once

#include "../Datasources/WavFileSampleReader.h"
#include "../Datasources/FolderReader.h"
#include "../Classifiers/ACP.h"
#include "../Classifiers/ChaineApprentissage.h"
#include "../FeatureProcessing/Preaccentuation.h"
#include "../FeatureProcessing/Normalisation.h"
#include "../FeatureProcessing/MFCC.h"
#include "../FeatureProcessing/DistanceFrameDeletion.h"
#include "../FeatureProcessing/Concatenate.h"
#include "../Entities/Array.h"

using namespace DataSources;
using namespace Classifiers;
using namespace FeatureProcessing;
using namespace Entities;

class ChaineACP : public ChaineApprentissage {
protected :
	WavFileSampleReader::type_pointer wavFile;

public :
	ChaineACP(string baseA, 
			string baseT, 
			int _nbAxes = 70, 
			int _nbCoeffs = 5, 
			int _nbSamplesPerFrame = 80, 
			int _nbFiltres = 10, 
			int _nbFrames = 45):
		ChaineApprentissage(new ACP(_nbAxes)){

		wavFile = new WavFileSampleReader;
		setTrainingReader(new FolderReader(wavFile, baseA));
		setReader(new FolderReader(wavFile, baseT));
		addProcessor(new Filtres::Preaccentuation);
		addProcessor(new Normalisation);
		addProcessor(new MFCC(_nbCoeffs, _nbSamplesPerFrame, _nbFiltres));
		addProcessor(new Redimensionnement::DistanceFrameDeletion(_nbFrames));
		addProcessor(new Concatenate());
	}

	void train(){
		ChaineApprentissage::train();
	}

	void recognize(){
		ChaineApprentissage::recognize();
	}
};